<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>

<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<title>更新菜品</title>
</head>
<body>
	<p><a href="list">&lt;&lt; 返回</a></p>
	<form action="update.action" method="post" enctype="multipart/form-data">
		<input type="hidden" name="did" value="${ form_dId }" />
		<input type="hidden" name="dimage" value="${ form_dImage }" />
		<fieldset>
			<legend>菜品信息</legend>
			<p>名称: <input type="text" name="dname" value="${ form_dName }"/>${ dNameError }</p>
			<p>类型: 
				<select name="dtype">
					<c:forEach items="${ dishTypes }" var="t">
						<c:if test="${ t.dishTypeNum gt 0 }">
							<option value="${ t.dishTypeNum }" ${ t.dishTypeNum eq form_dType ? "selected=\"selected\"" : "" }>${ t.dishTypeName }</option>
						</c:if>
					</c:forEach>
				</select>
				${ dTypeError }
			</p>
			<p>价格: <input type="text" name="dprice" value="${ form_dPrice }"/>${ dPriceError }</p>
			<p>图片: <input type="file" accept="image/jpeg" name="dimage"/>${ dImageError }</p>
			<p><input type="submit" value="提交"/></p>
		</fieldset>
	</form>
</body>
</html>